home *** CD-ROM | disk | FTP | other *** search
- property iHltsprite, iHowManyButton, iCastHeight, iCastWidth, iEachButtonWidth, iHltpixel, iEachButtonHeight, iFullCast, iSearchPopOut, iHeader, IEachButtonHeightModes
- global gHltPixel, gFlashPixel, gModeHighltSprite, gSearchPopOut, gHeaderHere, gHoldSearchInfo, gFindBase, gColorMac, gComputerTypeK, gExtraSpeed, gDefaultENTRYstate, gDefaultENCstate, gHoldEncPixelSprite, gHoldEntPixelSprite, gSearchButton, gDefaultSearchstate, gInputFieldSpr, gDefaultTextstate, gDefaultPixelstate, vENTRYpushBaseCast, gHoldENCstate, gBlankBar, gBtnHitSND, gFindSND, gTopicBase
-
- on birth me, pWhichSprite, pHowMany, pcastMem
- set iHltsprite to pWhichSprite
- set iHowManyButton to pHowMany + 0.0
- set iCastHeight to the height of cast pcastMem
- set iCastWidth to the width of cast pcastMem
- set iEachButtonHeight to iCastHeight / iHowManyButton
- set iEachButtonWidth to iCastWidth / iHowManyButton
- set iFullCast to pcastMem
- set IEachButtonHeightModes to iCastHeight / (iHowManyButton / 2)
- set iHltpixel to gHltPixel
- set iSearchPopOut to gSearchPopOut
- set iHeader to gHeaderHere
- return me
- end
-
- on mDumpParams me
- end
-
- on mHltVer me, pCheckSpeech
- global gSpeechCapable
- puppetSprite(iHltsprite, 1)
- set vMousePos to getAt(the clickLoc, 2)
- set vRelativeClick to vMousePos - the top of sprite iHltsprite
- set vWhere to integer((vRelativeClick / iEachButtonHeight) + 0.4999999)
- if vWhere < 1 then
- set vWhere to 1
- end if
- set whereHor to the left of sprite iHltsprite
- set whereVer to the top of sprite iHltsprite + ((vWhere - 1) * iEachButtonHeight)
- set vwhom to iFullCast + vWhere
- if pCheckSpeech = 1 then
- if (gSpeechCapable = 0) and (vWhere = 3) then
- return 0
- end if
- end if
- mSwitchCast(me, whereHor, whereVer, vwhom)
- puppetSprite(iHltsprite, 0)
- return vWhere
- end
-
- on mHltVerWithOption me, pCheckSpeech
- global gSpeechCapable
- puppetSprite(iHltsprite, 1)
- if inside(point(the mouseH, the mouseV), the rect of sprite iHltsprite) then
- set vMousePos to the mouseV
- end if
- set vRelativeClick to vMousePos - the top of sprite iHltsprite
- set vWhere to integer((vRelativeClick / iEachButtonHeight) + 0.4999999)
- if vWhere < 1 then
- set vWhere to 1
- end if
- set whereHor to the left of sprite iHltsprite
- set whereVer to the top of sprite iHltsprite + ((vWhere - 1) * iEachButtonHeight)
- set vwhom to iFullCast + vWhere
- mSwitchCastOptions(me, whereHor, whereVer, vwhom)
- return vWhere
- end
-
- on mHltTopVer me
- set vMousePos to getAt(the clickLoc, 2)
- set vRelativeClick to vMousePos - the top of sprite iHltsprite
- set vWhere to integer((vRelativeClick / iEachButtonHeight) + 0.4999999)
- if vWhere < 1 then
- set vWhere to 1
- end if
- if vWhere = 2 then
- set vWhere to 1
- end if
- set whereHor to the left of sprite iHltsprite
- set whereVer to the top of sprite iHltsprite + ((vWhere - 1) * iEachButtonHeight)
- set vwhom to iFullCast + vWhere
- hearit(gBtnHitSND)
- mSwitchHold(me, whereHor, whereVer, vwhom, gHltPixel)
- if vWhere = 3 then
- set the locH of sprite gHltPixel to -100
- updateStage()
- end if
- return vWhere
- end
-
- on mForceTopHlt me, pVal
- set whereHor to the left of sprite gTopicBase
- set whereVer to the top of sprite gTopicBase + ((pVal - 1) * iEachButtonHeight)
- set vwhom to iFullCast + pVal
- hearit(gBtnHitSND)
- mSwitchHold(me, whereHor, whereVer, vwhom, gHltPixel)
- if pVal = 3 then
- set the locH of sprite gHltPixel to -100
- updateStage()
- end if
- end
-
- on mPopSearchStrip me
- if gHoldSearchInfo = 0 then
- mOut(me)
- else
- min(me)
- end if
- end
-
- on mOut me
- set vWidthHeader to the right of sprite iHeader - the left of sprite iHeader
- mPopOut(me, iHeader, the right of sprite iHeader, 645 + vWidthHeader, 4 + (gExtraSpeed / 2))
- mPopOut(me, iSearchPopOut, 0, 636, 15 + gExtraSpeed)
- mMoveSearchStuff(me)
- set gHoldSearchInfo to 1
- end
-
- on min me
- mLoseSearchStuff(me)
- mPopIn(me, iSearchPopOut, the right of sprite iSearchPopOut, -2, -15 - gExtraSpeed)
- mPopIn(me, iHeader, the left of sprite iHeader, 632, -4 - (gExtraSpeed / 2))
- set gHoldSearchInfo to 0
- end
-
- on mMoveSearchStuff me
- mSwitchHold(me, 464, 26, gDefaultENTRYstate, gHoldEntPixelSprite)
- mSwitchHold(me, 579, 26, gDefaultENCstate, gHoldEncPixelSprite)
- mSwitchHold(me, 377, 26, gDefaultSearchstate, gSearchButton)
- mSwitchHold(me, 89, 19, gDefaultTextstate, gInputFieldSpr)
- set the editableText of sprite gInputFieldSpr to 1
- end
-
- on mLoseSearchStuff me
- mSwitchHold(me, 464, 470, gDefaultENTRYstate, gHoldEntPixelSprite)
- mSwitchHold(me, 579, 470, gDefaultENCstate, gHoldEncPixelSprite)
- mSwitchHold(me, 377, 470, gDefaultSearchstate, gSearchButton)
- mSwitchHold(me, 77, 470, gDefaultPixelstate, gInputFieldSpr)
- set the editableText of sprite gInputFieldSpr to 0
- end
-
- on mHltModes me
- puppetSprite(iHltsprite, 1)
- hputmsg(">mHltModes> iHltsprite" && iHltsprite)
- set vMousePos to getAt(the clickLoc, 2)
- set vMouseVer to getAt(the clickLoc, 1)
- set vRelativeClick to vMousePos - the top of sprite iHltsprite
- set vRelClickCheck to vMouseVer - the left of sprite iHltsprite
- set vWhere to integer((vRelativeClick / IEachButtonHeightModes) + 0.4999999)
- if vWhere < 1 then
- set vWhere to 1
- end if
- set whereHor to the left of sprite iHltsprite
- set whereVer to the top of sprite iHltsprite + ((vWhere - 1) * IEachButtonHeightModes)
- set vwhom to iFullCast + vWhere
- set vCenter to iCastWidth / 2
- if vRelClickCheck > vCenter then
- set vWhere to vWhere + 3
- set whereHor to the left of sprite iHltsprite + vCenter
- set whereVer to the top of sprite iHltsprite + ((vWhere - 1) * IEachButtonHeightModes) - iCastHeight
- set vwhom to iFullCast + vWhere
- end if
- hputmsg(">mHltModes> vWhere=" & vWhere & " vWhom=" & vwhom)
- mSwitchHold(me, whereHor, whereVer, vwhom, gModeHighltSprite)
- hputmsg("mHltModes> gModeHighltSprite" && gModeHighltSprite)
- return vWhere
- end
-
- on mSwitchCast me, whereHor, whereVer, vwhom
- puppetSprite(gFlashPixel, 1)
- set the locH of sprite gFlashPixel to whereHor
- set the locV of sprite gFlashPixel to whereVer
- set the castNum of sprite gFlashPixel to vwhom
- updateStage()
- hearit(gBtnHitSND)
- repeat while the stillDown
- nothing()
- end repeat
- puppetSprite(gFlashPixel, 0)
- end
-
- on mSwitchCastOptions me, whereHor, whereVer, vwhom
- puppetSprite(gFlashPixel, 1)
- set the locH of sprite gFlashPixel to whereHor
- set the locV of sprite gFlashPixel to whereVer
- set the castNum of sprite gFlashPixel to vwhom
- updateStage()
- hearit(gBtnHitSND)
- puppetSprite(gFlashPixel, 0)
- end
-
- on mPopOut me, whichsprite, vstartHere, vendHere, vDivide
- puppetSprite(whichsprite, 1)
- hearit(gFindSND)
- repeat with vstartHere = vstartHere to vendHere
- set the locH of sprite whichsprite to vstartHere
- set the locV of sprite whichsprite to 15
- set vstartHere to vstartHere + vDivide
- updateStage()
- end repeat
- set the locH of sprite whichsprite to vendHere
- set the locV of sprite whichsprite to 15
- updateStage()
- end
-
- on mPopIn me, whichsprite, vstartHere, vendHere, vDivide
- puppetSprite(whichsprite, 1)
- hearit(gFindSND)
- repeat with vstartHere = vstartHere down to vendHere
- set the locH of sprite whichsprite to vstartHere
- set the locV of sprite whichsprite to 15
- set vstartHere to vstartHere + vDivide
- updateStage()
- end repeat
- set the locH of sprite whichsprite to vendHere
- set the locV of sprite whichsprite to 15
- updateStage()
- end
-
- on mLeaveMode me
- puppetSprite(iHltpixel, 0)
- puppetSprite(iHltsprite, 0)
- puppetSprite(iHeader, 0)
- updateStage()
- end
-
- on mCheckHeader me
- if gHoldSearchInfo = 1 then
- puppetSprite(iHeader, 1)
- set vWidthHeader to the right of sprite iHeader - the left of sprite iHeader
- set whom to the castNum of sprite iHeader
- mSwitchHold(me, 645 + vWidthHeader, the top of sprite iHeader, whom, iHeader)
- else
- puppetSprite(iHeader, 1)
- set vWidthHeader to the right of sprite iHeader - the left of sprite iHeader
- set whom to the castNum of sprite iHeader
- mSwitchHold(me, 633, 15, whom, iHeader)
- end if
- end
-
- on mPushDown me, vHLoc, vendHere, vDivide
- puppetSprite(iHltsprite, 1)
- set the locH of sprite iHltsprite to vHLoc
- repeat with vstartHere = 0 to vendHere
- set the locV of sprite iHltsprite to vstartHere
- set vstartHere to vstartHere + vDivide
- updateStage()
- end repeat
- set the locV of sprite iHltsprite to vendHere
- updateStage()
- mRollOver(me)
- end
-
- on mRollOver me
- repeat while the stillDown
- if the mouseCast = iFullCast then
- set vMousePos to the mouseV
- set vRelativeClick to vMousePos - the top of sprite iHltsprite
- set vWhere to integer((vRelativeClick / (iEachButtonHeight + 0.0)) + 0.4999999)
- if vWhere < 1 then
- set vWhere to 1
- end if
- set whereHor to the left of sprite iHltsprite
- set whereVer to the top of sprite iHltsprite + ((vWhere - 1) * iEachButtonHeight)
- set vwhom to iFullCast + vWhere
- mSwitchCastHlt(me, whereHor, whereVer, vwhom)
- next repeat
- end if
- end repeat
- puppetSprite(iHltsprite, 0)
- if (the mouseCast > iFullCast) and (the mouseCast <= (iFullCast + iHowManyButton)) then
- if vENTRYpushBaseCast = iFullCast then
- set gDefaultENTRYstate to iFullCast + vWhere + iHowManyButton
- else
- set gDefaultENCstate to iFullCast + vWhere + iHowManyButton
- if gDefaultENCstate <> gBlankBar then
- set gHoldENCstate to gDefaultENCstate
- end if
- end if
- hSwitchScopeStuff(iHltsprite, vWhere)
- hearit(gBtnHitSND)
- updateStage()
- return vWhere
- end if
- end
-
- on mSwitchCastHlt me, whereHor, whereVer, vwhom
- puppetSprite(gFlashPixel, 1)
- set the locH of sprite gFlashPixel to whereHor
- set the locV of sprite gFlashPixel to whereVer
- set the castNum of sprite gFlashPixel to vwhom
- updateStage()
- puppetSprite(gFlashPixel, 0)
- end
-
- on mRollOverHorizontal me
- if the mouseCast = iFullCast then
- set vMousePos to the mouseH
- set vRelativeClick to vMousePos - the left of sprite iHltsprite
- set vWhere to integer((vRelativeClick / (iEachButtonWidth + 0.0)) + 0.4999999)
- if vWhere < 1 then
- set vWhere to 1
- end if
- set whereHor to the left of sprite iHltsprite + ((vWhere - 1) * iEachButtonWidth)
- set whereVer to the top of sprite iHltsprite
- set vwhom to iFullCast + vWhere
- mSwitchCastHlt(me, whereHor, whereVer, vwhom)
- return vWhere
- else
- return
- end if
- end
-
- on mClearTopHlt me
- set the locH of sprite gHltPixel to -100
- updateStage()
- puppetSprite(gHltPixel, 0)
- end
-
- on mHltfromScripts me, vWhere
- puppetSprite(iHltsprite, 1)
- set whereVer to the top of sprite iHltsprite
- set whereHor to the left of sprite iHltsprite + ((vWhere - 1) * iEachButtonWidth)
- set vwhom to iFullCast + vWhere
- mSwitchHold(me, whereHor, whereVer, vwhom, iHltpixel)
- end
-
- on mHltfromScriptsVer me, vWhere
- puppetSprite(iHltsprite, 1)
- set whereHor to the left of sprite iHltsprite
- set whereVer to the top of sprite iHltsprite + ((vWhere - 1) * iEachButtonHeight)
- set vwhom to iFullCast + vWhere
- mSwitchHold(me, whereHor, whereVer, vwhom, iHltpixel)
- end
-
- on mHltfromScriptsVer2 me, vWhere
- puppetSprite(iHltsprite, 1)
- set whereHor to the left of sprite iHltsprite
- set whereVer to the top of sprite iHltsprite + ((vWhere - 1) * iEachButtonHeight)
- set vwhom to iFullCast + vWhere
- mSwitchHold(me, whereHor, whereVer, vwhom, gHltPixel)
- end
-
- on mHltFromScriptModes me, vWhere
- puppetSprite(iHltsprite, 1)
- set whereHor to the left of sprite iHltsprite
- set whereVer to the top of sprite iHltsprite + ((vWhere - 1) * IEachButtonHeightModes)
- set vwhom to iFullCast + vWhere
- set vCenter to iCastWidth / 2
- if vWhere > 3 then
- set whereHor to the left of sprite iHltsprite + vCenter
- set whereVer to the top of sprite iHltsprite + ((vWhere - 1) * IEachButtonHeightModes) - iCastHeight
- set vwhom to iFullCast + vWhere
- end if
- mSwitchHold(me, whereHor, whereVer, vwhom, gModeHighltSprite)
- end
-
- on mSwitchHold me, whereHor, whereVer, vwhom, whichpixel
- puppetSprite(whichpixel, 1)
- set the locH of sprite whichpixel to whereHor
- set the locV of sprite whichpixel to whereVer
- set the castNum of sprite whichpixel to vwhom
- updateStage()
- end
-